const { Sequelize, DataTypes } = require('sequelize');
const config = require('../config/config.js');
const sequelize = new Sequelize(config);

let tabModel = sequelize.define(
	'tab',
	{
		// 在这里定义模型属性
		name: {
			type: DataTypes.STRING,
			comment: '名称'
		},
		created_time: {
			type: Sequelize.INTEGER,
			comment: '创建时间',
			defaultValue: Date.parse(new Date()) / 1000
		},
		updated_time: {
			type: Sequelize.INTEGER,
			comment: '更新时间',
			defaultValue: Date.parse(new Date()) / 1000
		}
	},
	{
		// 这是其他模型参数
		timestamps: false,
		tableName: 'tab'
	}
);

module.exports = tabModel;
